import { request } from 'umi';

//今日数据概览接口地址
export const TODAYDATA = '/dashborad/today';

/**
 * 获取当日疫情数据总览
 * 包括 新增本土确诊，新增确诊，新增境外，新增无症状，
 * 现存本土确诊，现存确诊，现存无症状，现存重症
 * @param params
 */
export async function getTodayTotalData(options?: Record<string, any>) {
  return request<Record<string, any>>(TODAYDATA, {
    method: 'GET',
    ...(options || {}),
  });
}
//获取具体的自定义语法规则
export const CUSTOMEDESIGNGRAMMER = '/api/indicatorList?';

/**
 * 获取指定公式
 * @param code 具体语法规则代码
 * @param options
 * @returns
 */
export async function getCustomeDesignGrammer(
  grammerData?: DASHBOARD.GrammerData,
  options?: Record<string, any>,
) {
  return request<Record<string, any>>(CUSTOMEDESIGNGRAMMER + 'code=' + grammerData?.code, {
    method: 'GET',
    ...(options || {}),
  });
}
